import React, { Component } from 'react'
import PropType from 'prop-types'
export default class Props extends Component {
  static PropType = {
    name:PropType.string.isRequired,
    age:PropType.number,
    gender:PropType.string
  }
  // 给proptype设置默认值
  static defaultProps = {
    name:'张三'
  }
  render() {
    // props
    let {name,age} = this.props
    return (
      <ul>
        <li>姓名:{name}</li>
        <li>年龄:{age}</li>
      </ul>
    )
  }
}
